#pragma once
//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#define RC_SYS_PKT_AUTH_MAX_MSG_LEN		199

#pragma pack(push) 
#pragma pack(1)
class RcSysPktAuth : public RcSysPktHdr
{
public:
	//=== constructor/destructor ===//
	RcSysPktAuth()
	{
		m_u16PktLen		= 16;		
		m_u16PktType	= RC_SYS_PKT_TYPE_AUTH; 
		m_u16Version	= 1;  
		m_u16AuthType	= eFriendStateAnonymous;  
		m_u16AuthFlags	= 0;  
		m_u16MsgLen		= 0;
		m_u16Res2		= 0;
		m_u16Res3		= 0;
	};
	void AddMsg( std::string & csMsg );
	void GetMsg( std::string & csRetMsg );
	RcSysPktAuth * MakeCopy( void )
	{
		RcSysPktAuth * pgRcSysPktAuth = ( RcSysPktAuth * )new char[ m_u16PktLen ];
		memcpy( pgRcSysPktAuth, this, m_u16PktLen );
		return pgRcSysPktAuth;
	}

public:
	//=== vars ===//
	U16		m_u16Version;
	U16		m_u16AuthType;
	U16		m_u16AuthFlags;
	U16		m_u16MsgLen;
	U16		m_u16Res2;
	U16		m_u16Res3;
	U8		m_au8Additional[ RC_SYS_PKT_AUTH_MAX_MSG_LEN + 1 ];

};

#pragma pack(pop)
